/**
 * Company : SIANGKLOM.
 * Created By : Chatree Siangklom
 * Created On : Oct 15, 2013  10:18:42 AM 
 * e-Mail : dr_chatree@hotmail.com
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : com.tis.database.services.promis.impl
 * File Name : PmsPaymentsReceivedServicesImpl.java
 * TODO
 */
package com.tis.database.services.promis.impl;

import java.math.BigDecimal;
import java.util.List;

import org.hibernate.HibernateException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tis.database.dao.promis.PmsPaymentsReceivedDao;
import com.tis.database.entitys.promis.GlPostingDetail;
import com.tis.database.entitys.promis.PmsPaymentsReceived;
import com.tis.database.entitys.promis.PmsPaymentsReceivedPK;
import com.tis.database.services.promis.IPmsPaymentsReceivedServices;

/**
 * @author Chatree Siangklom of Administrator
 * Date =Oct 15, 2013 : 10:18:42 AM 
 * CreateBy=Chatree Siangklom
 * 
 * PmsPaymentsReceivedServicesImpl
 * TODO
 */
@Service
@Transactional(readOnly=true)
public class PmsPaymentsReceivedServicesImpl implements IPmsPaymentsReceivedServices {
	
	private static final Logger logging = LoggerFactory.getLogger(PmsPaymentsReceivedServicesImpl.class);
	
	@Autowired
	private PmsPaymentsReceivedDao pmsPaymentsReceivedDao;
	
	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPmsPaymentsReceivedServices#findById(com.tis.database.entitys.promis.PmsPaymentsReceivedPK)
	 * Date =Oct 15, 2013 : 10:18:42 AM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	public PmsPaymentsReceived findById(PmsPaymentsReceivedPK id) throws HibernateException {
		return pmsPaymentsReceivedDao.findById(id);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPmsPaymentsReceivedServices#NextInstanceNo()
	 * Date =Oct 15, 2013 : 10:18:42 AM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public BigDecimal NextInstanceNo() throws HibernateException, Exception {
		// TODO Auto-generated method stub
		return pmsPaymentsReceivedDao.NextInstanceNo();
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPmsPaymentsReceivedServices#NextSequence(java.lang.String)
	 * Date =Oct 15, 2013 : 10:18:42 AM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public BigDecimal NextSequence(String name) throws HibernateException, Exception {
		// TODO Auto-generated method stub
		return pmsPaymentsReceivedDao.NextSequence(name);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPmsPaymentsReceivedServices#saveOrUpdate(java.util.List)
	 * Date =Oct 15, 2013 : 10:18:42 AM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public void saveOrUpdate(List<PmsPaymentsReceived> e) throws HibernateException {
		// TODO Auto-generated method stub
		pmsPaymentsReceivedDao.saveOrUpdate(e);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPmsPaymentsReceivedServices#saveOrUpdate(com.tis.database.entitys.promis.PmsPaymentsReceived)
	 * Date =Oct 15, 2013 : 10:18:42 AM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public void saveOrUpdate(PmsPaymentsReceived e) throws HibernateException {
		// TODO Auto-generated method stub
		pmsPaymentsReceivedDao.saveOrUpdate(e);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPmsPaymentsReceivedServices#UpdatedBack(com.tis.database.entitys.promis.GlPostingDetail)
	 * Date =Oct 15, 2013 : 10:18:42 AM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public void UpdateBackSapMessage(GlPostingDetail glPostingDetail) throws HibernateException, Exception {
		// TODO Auto-generated method stub
		pmsPaymentsReceivedDao.UpdatedBack(glPostingDetail);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPmsPaymentsReceivedServices#FindByIs(java.lang.String, java.lang.String, java.lang.String, int)
	 * Date =Oct 30, 2013 : 11:21:43 AM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	public List<PmsPaymentsReceived> FindByIs(String status, String syncIsstaging, String syncIssync, int maxResult) throws Exception {
		// TODO Auto-generated method stub
		return pmsPaymentsReceivedDao.FindByIs(status, syncIsstaging, syncIssync, maxResult);
	}

}
